#!/bin/bash
echo "Building Modern AI Agent System..."
echo

WXWIN="/d/vc/wxWidgets-3.2.7"

# Build agent system
echo "1. Building AI Agent System..."
g++ -std=c++17 -O2 -Wall -Wextra \
    -I"$WXWIN/include" \
    -I"$WXWIN/lib/wx/include/msw-unicode-3.2" \
    -D__WXMSW__ -D_UNICODE -DUNICODE \
    src/ai_agent.cpp \
    src/agents.cpp \
    src/modern_chat_app.cpp \
    -L"$WXWIN/lib" \
    -lwxmsw32u_core_gcc_custom -lwxbase32u_gcc_custom \
    -lwxmsw32u_adv_gcc_custom \
    -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 \
    -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid \
    -lcomctl32 -lrpcrt4 -loleacc -luxtheme \
    -o modern_ai_chat.exe

if [[ $? -eq 0 ]]; then
    echo "✅ Modern AI system built: modern_ai_chat.exe"
    
    # Set PATH and test
    export PATH="$WXWIN/lib:$PATH"
    echo "🚀 You can now run: ./modern_ai_chat.exe"
    
    echo
    echo "🎉 现代AI智能体系统已就绪！"
    echo "✨ 特性："
    echo "   • 🤖 多智能体架构"
    echo "   • 💬 自然语言对话"
    echo "   • 🔍 代码分析能力"
    echo "   • 📁 文件系统集成"
    echo "   • 🎨 现代UI界面"
else
    echo "❌ Build failed"
fi
